//package com.tianjishuju.cimiss.station.station.util;
//
//
//import com.mysql.jdbc.Connection;
//import com.mysql.jdbc.PreparedStatement;
//
///**
// * Created by eric on 18/6/6.
// */
//
//
//import java.io.BufferedReader;
//import java.io.File;
//import java.io.FileReader;
//import java.sql.DriverManager;
//import java.sql.SQLNonTransientException;
//import java.util.ArrayList;
//import java.util.Collections;
//import java.util.Date;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//public class CimissToMysqlUtil {
//
//	private final static Logger logger = LoggerFactory.getLogger(CimissToMysqlUtil.class);
//
//	/**
//	 * 获取路径下的所有文件/文件夹
//	 * 
//	 * @param directoryPath
//	 *            需要遍历的文件夹路径
//	 * @param isAddDirectory
//	 *            是否将子文件夹的路径也添加到list集合中
//	 * @return
//	 */
//	public static ArrayList<String> getAllFile(String directoryPath, boolean isAddDirectory) {
//		ArrayList<String> list = new ArrayList<String>();
//		File baseFile = new File(directoryPath);
//		if (baseFile.isFile() || !baseFile.exists()) {
//			return list;
//		}
//		File[] files = baseFile.listFiles();
//		for (File file : files) {
//			if (file.isDirectory()) {
//				if (isAddDirectory) {
//					list.add(file.getAbsolutePath());
//				}
//				list.addAll(getAllFile(file.getAbsolutePath(), isAddDirectory));
//			} else {
//				list.add(file.getAbsolutePath());
//			}
//		}
//		return list;
//	}
//
//	public void test1() {
//		String driver = "com.mysql.jdbc.Driver";
//		String url = "jdbc:mysql://10.0.3.192:3306/parse-radar?characterEncoding=UTF-8";
//		String user = "root";
//		String password = "Tjsj";
//		Connection conn;
//		PreparedStatement stmt;
//		BufferedReader reader = null;
//		String temp = null;
//
//		try {
//			ArrayList<String> dc = new ArrayList<String>();
//			String filepath = "/test/app/flink/data/cimissfile/eric";
//			dc = getAllFile(filepath, true);
//			int n = 1;
//			String sql = "";
//			for (String fileStr : dc) {
//				if (StringFileUtils.getFileNameWithSuffix(fileStr).startsWith("."))
//					continue;
//				System.out.println("n:" + n + " " + fileStr);
//				sql = "insert into cimiss(id,station_id_c,radarTime,lon,lat,pre_1h,pre_3h,pre_6h,pre_12h,pre_24h,pre,win_s_avg_2mi,rhu,tem,prs_sea,dpt)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
//				System.out.println("n: " + sql);
//				n++;
//
//				File file = new File(fileStr);
//				reader = null;
//				temp = null;
//				int line = 1;
//
//				String radartime = StringFileUtils.getFileName(fileStr).split("_")[2];
//				System.out.println("radartime: " + radartime);
//				reader = new BufferedReader(new FileReader(file));
//
//				Class.forName(driver);
//				conn = (Connection) DriverManager.getConnection(url, user, password);
//				stmt = (PreparedStatement) conn.prepareStatement(sql);
//
//				while ((temp = reader.readLine()) != null) {
//					System.out.println("n: " + n + "line" + line + ":" + temp);
//					if (line >= 3) {
//						String arr[] = temp.split("\\s+");
//
//						try {
//
//							stmt.clearParameters();
//
//							stmt.setString(1, arr[0] + radartime);
//							stmt.setString(2, arr[0]);
//							stmt.setLong(3, Long.valueOf(radartime));
//							stmt.setDouble(4, Double.valueOf(arr[1]));
//							stmt.setDouble(5, Double.valueOf(arr[2]));
//							stmt.setDouble(6, Double.valueOf(arr[3]));
//							stmt.setDouble(7, Double.valueOf(arr[4]));
//							stmt.setDouble(8, Double.valueOf(arr[5]));
//							stmt.setDouble(9, Double.valueOf(arr[6]));
//							stmt.setDouble(10, Double.valueOf(arr[7]));
//							stmt.setDouble(11, Double.valueOf(arr[8]));
//							stmt.setDouble(12, Double.valueOf(arr[9]));
//							stmt.setDouble(13, Double.valueOf(arr[10]));
//							stmt.setDouble(14, Double.valueOf(arr[11]));
//							stmt.setDouble(15, Double.valueOf(arr[12]));
//							stmt.setDouble(16, Double.valueOf(arr[13]));
//
//							stmt.execute();
//
//						} catch (SQLNonTransientException e) {
//							// TODO 自动生成的 catch 块
//							e.printStackTrace();
//						}
//
//						System.out.println("================");
//					}
//					line++;
//
//				}
//
//			}
//		} catch (Exception e) {
//			e.printStackTrace();
//		} finally {
//			if (reader != null) {
//				try {
//					reader.close();
//				} catch (Exception e) {
//					e.printStackTrace();
//				}
//			}
//		}
//	}
//	public static void test2() {
//		String driver = "com.mysql.jdbc.Driver";
//		String url = "jdbc:mysql://10.0.3.192:3306/parse-radar?characterEncoding=UTF-8";
//		String user = "root";
//		String password = "Tjsj";
//		Connection conn;
//		PreparedStatement stmt;
//		BufferedReader reader = null;
//		String temp = null;
//
//		try {
//			ArrayList<String> dc = new ArrayList<String>();
//			String filepath = "/test/app/flink/data/cimissfile/temp";
//			dc = getAllFile(filepath, true);
//			int n = 1;
//			String sql = "";
//			for (String fileStr : dc) {
//				if (StringFileUtils.getFileNameWithSuffix(fileStr).startsWith("."))
//					continue;
//				System.out.println("n:" + n + " " + fileStr);
//				sql = "insert into cimiss_station(id,station_id_c,lon,lat,station_name,country,province,city,cnty,town)values(?,?,?,?,?,?,?,?,?,?)";
//		
///**
// * 1 + 9  [0 1 2 3 4 5 6 7 8]
// * 
// * id [Station_ID_C Lon Lat Station_Name Country Province City Cnty Town]
// * 
//				
// */
//				
//				System.out.println("n: " + sql);
//				
//				File file = new File(fileStr);
//				reader = null;
//				temp = null;
//				int line = 1;
//				int id_n = 0;
//				
//				String radartime = StringFileUtils.getFileName(fileStr).split("_")[2];
//				System.out.println("radartime: " + radartime);
//				reader = new BufferedReader(new FileReader(file));
//
//				Class.forName(driver);
//				conn = (Connection) DriverManager.getConnection(url, user, password);
//				stmt = (PreparedStatement) conn.prepareStatement(sql);
//
//				while ((temp = reader.readLine()) != null) {
//					try {
//						if (line >= 3) {
//							String arr[] = temp.split("\\s+");
//							int arrLen = arr.length;
////							
//							switch (arrLen) {
//							case 6: {
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setString(2, arr[0]);
//								stmt.setDouble(3, Double.valueOf(arr[1]));
//								stmt.setDouble(4, Double.valueOf(arr[2]));
//
//								stmt.setString(5, arr[3]);
//								stmt.setString(6, arr[4]);
//								stmt.setString(7, arr[5]);
//
//								stmt.setString(8, "");
//								stmt.setString(9, "");
//								stmt.setString(10, "");
//							}
//								break;
//							case 7: {
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setString(2, arr[0]);
//								stmt.setDouble(3, Double.valueOf(arr[1]));
//								stmt.setDouble(4, Double.valueOf(arr[2]));
//
//								stmt.setString(5, arr[3]);
//								stmt.setString(6, arr[4]);
//								stmt.setString(7, arr[5]);
//
//								stmt.setString(8, arr[6]);
//								stmt.setString(9, "");
//								stmt.setString(10, "");
//							}
//								break;
//							case 8: {
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setString(2, arr[0]);
//								stmt.setDouble(3, Double.valueOf(arr[1]));
//								stmt.setDouble(4, Double.valueOf(arr[2]));
//
//								stmt.setString(5, arr[3]);
//								stmt.setString(6, arr[4]);
//								stmt.setString(7, arr[5]);
//
//								stmt.setString(8, arr[6]);
//								stmt.setString(9, arr[7]);
//								stmt.setString(10, "");
//							}
//								break;
//							case 9: {
//								id_n++;
//								System.out.println("9");
//								stmt.setInt(1, id_n);
//								stmt.setString(2, arr[0]);
//								stmt.setDouble(3, Double.valueOf(arr[1]));
//								stmt.setDouble(4, Double.valueOf(arr[2]));
//
//								stmt.setString(5, arr[3]);
//								stmt.setString(6, arr[4]);
//								stmt.setString(7, arr[5]);
//
//								stmt.setString(8, arr[6]);
//								stmt.setString(9, arr[7]);
//								stmt.setString(10, arr[8]);
//							}
//								break;
//							default: {
//								System.out.println("n: " + n + " line" + line + ":" + temp);
//								line++;
//								continue;
//							}
//							}
//							stmt.execute();
//
//						}
//					} catch (SQLNonTransientException e) {
//						// TODO 自动生成的 catch 块
//						e.printStackTrace();
//					}
//					line++;
//				}
//				n++;
//			}
//		} catch (Exception e) {
//			e.printStackTrace();
//		} finally {
//			if (reader != null) {
//				try {
//					reader.close();
//				} catch (Exception e) {
//					e.printStackTrace();
//				}
//			}
//		}
//	}
//	
//	//解析所有字符串
//	public static void test3() {
//		String driver = "com.mysql.jdbc.Driver";
//		String url = "jdbc:mysql://10.0.3.192:3306/parse-radar?characterEncoding=UTF-8";
//		String user = "root";
//		String password = "Tjsj";
//		Connection conn;
//		PreparedStatement stmt;
//		BufferedReader reader = null;
//		String temp = null;
//
//		int line = 1;
//		int id_n = 0;
//		
//		try {
//			ArrayList<String> dc = new ArrayList<String>();
//			String filepath = "/test/app/flink/data/cimissfile/eric_t";
//			dc = getAllFile(filepath, true);
//			
//			Collections.sort(dc);
//			
//			//第几个文件
//			int n = 0;
//			long taskStartTime = 0;
//			long duringTime = 0;
//			long sumTime = 0;
//			String sql = "";
//			for (String fileStr : dc) {
//				if (StringFileUtils.getFileNameWithSuffix(fileStr).startsWith(".") || StringFileUtils.getFileNameWithSuffix(fileStr).startsWith("temp_"))
//					continue;
//				taskStartTime = System.currentTimeMillis();
//				Date date = new Date(taskStartTime);
//				System.out.println("n:" + n + " id_n:"+id_n+ " " + fileStr);
//				System.out.println("currentTime:"+ DateFormatUtil.getDateFormatess(date) + ", duringtime: " + duringTime+" ms , sumTime : " + sumTime + "ms .");
//				if(n>=1) {
//					break;
//				}
//				sql = "insert into cimiss_t(id,station_time,pre_id,Station_ID_C,Lon,Lat,PRE_1h,PRE_3h,PRE_6h,PRE_12h,PRE_24h,PRE,WIN_S_Avg_2mi,WIN_S_Inst_Max,RHU,TEM,PRS_Sea,DPT,Station_Type,Station_levl,Admin_Code_CHN,Station_Name,Country,Province,City,Cnty,Town)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
//
//				/**
//				 * 1 + 9 [0 1 2 3 4 5 6 7 8]
//				 * 
//				 * id [Station_ID_C Lon Lat Station_Name Country Province City
//				 * Cnty Town]
//				 * 
//				 * 3 + 15 + 6 ; [0-14] 15 16 17 18 19 20 Station_Name Country
//				 * Province City Cnty Town id station_time pre_id
//				 * [Station_ID_C,Lon,Lat,PRE_1h,PRE_3h,PRE_6h,PRE_12h,PRE_24h,PRE,WIN_S_Avg_2mi,WIN_S_Inst_Max,
//				 * RHU,TEM,PRS_Sea,DPT,Station_Name,Country,Province,City,Cnty,Town]
//				 * 
//				 * 
//				 */
//
//				System.out.println("n: " + sql);
//
//				File file = new File(fileStr);
//				reader = null;
//				temp = null;
//				line = 1;
////				id_n = 0;
//
//				String radartime = StringFileUtils.getFileName(fileStr).split("_")[2];
//				System.out.println("radartime: " + radartime);
//				reader = new BufferedReader(new FileReader(file));
//
//				Class.forName(driver);
//				conn = (Connection) DriverManager.getConnection(url, user, password);
//				stmt = (PreparedStatement) conn.prepareStatement(sql);
//
//				while ((temp = reader.readLine()) != null) {
//					try {
//						if (line >= 3) {
//							String arr[] = temp.split("\\s+");
//							int arrLen = arr.length;
//							//
//							switch (arrLen) {
//							case 18: {
////								  `id` bigint(16) unsigned NOT NULL auto_increment COMMENT '自增序列',
////								  `station_time` bigint(16) NOT NULL DEFAULT '0' COMMENT '时间',
////								  `pre_id` varchar(255) NOT NULL DEFAULT '' COMMENT '唯一 Station_ID_C + radarTime',
////
////								  `Station_ID_C` varchar(16) DEFAULT '' COMMENT '站点id',
////								
////								  `Lon` double DEFAULT '0' COMMENT '站点经度', 1
////								  `Lat` double DEFAULT '0' COMMENT '站点维度', 2
////								  `PRE_1h` double DEFAULT '0' COMMENT '过去 1 小时降水量 毫米', 3
////								  `PRE_3h` double DEFAULT '0' COMMENT '过去 3 小时降水量 毫米', 4
////								  `PRE_6h` double DEFAULT '0' COMMENT '过去 6 小时降水量 毫米', 5
////								  `PRE_12h` double DEFAULT '0' COMMENT '过去 12 小时降水量 毫米', 6
////								  `PRE_24h` double DEFAULT '0' COMMENT '过去 24 小时降水量 毫米', 7
////								  `PRE` double DEFAULT '0' COMMENT '平均降水量 毫米', 8
////								  `WIN_S_Avg_2mi` double NOT NULL DEFAULT '0' COMMENT '2分钟平均风速 米/秒', 9
////								  `WIN_S_Inst_Max` double NOT NULL DEFAULT '0' COMMENT '极大风速 米/秒', 10
////								  `RHU` double NOT NULL DEFAULT '0' COMMENT '湿度 百分率', 11
////								  `TEM` double NOT NULL DEFAULT '0' COMMENT '气温 摄氏度(℃)', 12
////								  `PRS_Sea` double NOT NULL DEFAULT '0' COMMENT '气压 百帕', 13 
////								  `DPT` double NOT NULL DEFAULT '0' COMMENT '露点温度 摄氏度(℃)', 14
////								
////								  `Station_Type` varchar(255) DEFAULT '' COMMENT '测站类型', 15
////								  `Station_levl` varchar(255) DEFAULT '' COMMENT '测站级别', 16
////								  `Admin_Code_CHN` varchar(255) DEFAULT '' COMMENT '行政区代码', 17
////								
////								  `Station_Name` varchar(255) DEFAULT '' COMMENT '站点名称',
////								  `Country` varchar(255) DEFAULT '' COMMENT '国家',
////								  `Province` varchar(255) DEFAULT '' COMMENT '省份',
////								  `City` varchar(255) DEFAULT '' COMMENT '地市',
////								  `Cnty` varchar(255) DEFAULT '' COMMENT '区县',
////								  `Town` varchar(255) DEFAULT '' COMMENT '乡镇',
////								if(arr[3].compareTo("900000") > 0) arr[3] = "0";
////								if(arr[4].compareTo("900000") > 0) arr[4] = "0";
////								if(arr[5].compareTo("900000") > 0) arr[5] = "0";
////								if(arr[6].compareTo("900000") > 0) arr[6] = "0";
////								if(arr[7].compareTo("900000") > 0) arr[7] = "0";
////								if(arr[8].compareTo("900000") > 0) arr[8] = "0";
////								if(arr[9].compareTo("900000") > 0) arr[9] = "0";
////								if(arr[10].compareTo("900000") > 0) arr[10] = "0";
////								if(arr[11].compareTo("900000") > 0) arr[11] = "0";
////								if(arr[12].compareTo("900000") > 0) arr[12] = "0";
////								if(arr[13].compareTo("900000") > 0) arr[13] = "0";
////								if(arr[14].compareTo("900000") > 0) arr[14] = "0";
//								
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setLong(2, Long.valueOf(radartime));
//								stmt.setString(3, arr[0] + radartime);
//								stmt.setString(4, arr[0]);
//
//								stmt.setDouble(5, Double.valueOf(arr[1]));
//								stmt.setDouble(6, Double.valueOf(arr[2]));
//								stmt.setDouble(7, Double.valueOf(arr[3]));
//								stmt.setDouble(8, Double.valueOf(arr[4]));
//								stmt.setDouble(9, Double.valueOf(arr[5]));
//								stmt.setDouble(10, Double.valueOf(arr[6]));
//								stmt.setDouble(11, Double.valueOf(arr[7]));
//								stmt.setDouble(12, Double.valueOf(arr[8]));
//								stmt.setDouble(13, Double.valueOf(arr[9]));
//								stmt.setDouble(14, Double.valueOf(arr[10]));
//								stmt.setDouble(15, Double.valueOf(arr[11]));
//								stmt.setDouble(16, Double.valueOf(arr[12]));
//								stmt.setDouble(17, Double.valueOf(arr[13]));
//								stmt.setDouble(18, Double.valueOf(arr[14]));
//								
//								stmt.setString(19, arr[15]);
//								stmt.setString(20, arr[16]);
//								stmt.setString(21, arr[17]);
//
//								stmt.setString(22, "");
//								stmt.setString(23, "");
//								stmt.setString(24, "");
//								stmt.setString(25, "");
//								stmt.setString(26, "");
//								stmt.setString(27, "");
//							}
//								break;
//							case 19: {
////								if(arr[3].compareTo("900000") > 0) arr[3] = "0";
////								if(arr[4].compareTo("900000") > 0) arr[4] = "0";
////								if(arr[5].compareTo("900000") > 0) arr[5] = "0";
////								if(arr[6].compareTo("900000") > 0) arr[6] = "0";
////								if(arr[7].compareTo("900000") > 0) arr[7] = "0";
////								if(arr[8].compareTo("900000") > 0) arr[8] = "0";
////								if(arr[9].compareTo("900000") > 0) arr[9] = "0";
////								if(arr[10].compareTo("900000") > 0) arr[10] = "0";
////								if(arr[11].compareTo("900000") > 0) arr[11] = "0";
////								if(arr[12].compareTo("900000") > 0) arr[12] = "0";
////								if(arr[13].compareTo("900000") > 0) arr[13] = "0";
////								if(arr[14].compareTo("900000") > 0) arr[14] = "0";
//								
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setLong(2, Long.valueOf(radartime));
//								stmt.setString(3, arr[0] + radartime);
//								stmt.setString(4, arr[0]);
//
//								stmt.setDouble(5, Double.valueOf(arr[1]));
//								stmt.setDouble(6, Double.valueOf(arr[2]));
//								stmt.setDouble(7, Double.valueOf(arr[3]));
//								stmt.setDouble(8, Double.valueOf(arr[4]));
//								stmt.setDouble(9, Double.valueOf(arr[5]));
//								stmt.setDouble(10, Double.valueOf(arr[6]));
//								stmt.setDouble(11, Double.valueOf(arr[7]));
//								stmt.setDouble(12, Double.valueOf(arr[8]));
//								stmt.setDouble(13, Double.valueOf(arr[9]));
//								stmt.setDouble(14, Double.valueOf(arr[10]));
//								stmt.setDouble(15, Double.valueOf(arr[11]));
//								stmt.setDouble(16, Double.valueOf(arr[12]));
//								stmt.setDouble(17, Double.valueOf(arr[13]));
//								stmt.setDouble(18, Double.valueOf(arr[14]));
//
//								stmt.setString(19, arr[15]);
//								stmt.setString(20, arr[16]);
//								stmt.setString(21, arr[17]);
//								
//								// `Station_Name` varchar(255) DEFAULT ''
//								// COMMENT '站点名称',
//								if (!arr[18].equals("中国")) {
//									stmt.setString(22, arr[18]);
//								} else {
//									stmt.setString(22, "");
//								}
//								stmt.setString(23, "");
//								stmt.setString(24, "");
//								stmt.setString(25, "");
//								stmt.setString(26, "");
//								stmt.setString(27, "");
//							}
//								break;
//							case 20: {
////								if(arr[3].compareTo("900000") > 0) arr[3] = "0";
////								if(arr[4].compareTo("900000") > 0) arr[4] = "0";
////								if(arr[5].compareTo("900000") > 0) arr[5] = "0";
////								if(arr[6].compareTo("900000") > 0) arr[6] = "0";
////								if(arr[7].compareTo("900000") > 0) arr[7] = "0";
////								if(arr[8].compareTo("900000") > 0) arr[8] = "0";
////								if(arr[9].compareTo("900000") > 0) arr[9] = "0";
////								if(arr[10].compareTo("900000") > 0) arr[10] = "0";
////								if(arr[11].compareTo("900000") > 0) arr[11] = "0";
////								if(arr[12].compareTo("900000") > 0) arr[12] = "0";
////								if(arr[13].compareTo("900000") > 0) arr[13] = "0";
////								if(arr[14].compareTo("900000") > 0) arr[14] = "0";
//								
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setLong(2, Long.valueOf(radartime));
//								stmt.setString(3, arr[0] + radartime);
//								stmt.setString(4, arr[0]);
//
//								stmt.setDouble(5, Double.valueOf(arr[1]));
//								stmt.setDouble(6, Double.valueOf(arr[2]));
//								stmt.setDouble(7, Double.valueOf(arr[3]));
//								stmt.setDouble(8, Double.valueOf(arr[4]));
//								stmt.setDouble(9, Double.valueOf(arr[5]));
//								stmt.setDouble(10, Double.valueOf(arr[6]));
//								stmt.setDouble(11, Double.valueOf(arr[7]));
//								stmt.setDouble(12, Double.valueOf(arr[8]));
//								stmt.setDouble(13, Double.valueOf(arr[9]));
//								stmt.setDouble(14, Double.valueOf(arr[10]));
//								stmt.setDouble(15, Double.valueOf(arr[11]));
//								stmt.setDouble(16, Double.valueOf(arr[12]));
//								stmt.setDouble(17, Double.valueOf(arr[13]));
//								stmt.setDouble(18, Double.valueOf(arr[14]));
//
//								stmt.setString(19, arr[15]);
//								stmt.setString(20, arr[16]);
//								stmt.setString(21, arr[17]);
//								
//								if (arr[19].equals("中国")) {
//									stmt.setString(22, arr[18]);
//									stmt.setString(23, arr[19]);
//								} else {
//									stmt.setString(22, "");
//									stmt.setString(23, "");
//								}
//								stmt.setString(24, "");
//								stmt.setString(25, "");
//								stmt.setString(26, "");
//								stmt.setString(27, "");
//							}
//								break;
//							case 21: {
////								if(arr[3].compareTo("900000") > 0) arr[3] = "0";
////								if(arr[4].compareTo("900000") > 0) arr[4] = "0";
////								if(arr[5].compareTo("900000") > 0) arr[5] = "0";
////								if(arr[6].compareTo("900000") > 0) arr[6] = "0";
////								if(arr[7].compareTo("900000") > 0) arr[7] = "0";
////								if(arr[8].compareTo("900000") > 0) arr[8] = "0";
////								if(arr[9].compareTo("900000") > 0) arr[9] = "0";
////								if(arr[10].compareTo("900000") > 0) arr[10] = "0";
////								if(arr[11].compareTo("900000") > 0) arr[11] = "0";
////								if(arr[12].compareTo("900000") > 0) arr[12] = "0";
////								if(arr[13].compareTo("900000") > 0) arr[13] = "0";
////								if(arr[14].compareTo("900000") > 0) arr[14] = "0";
//								
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setLong(2, Long.valueOf(radartime));
//								stmt.setString(3, arr[0] + radartime);
//								stmt.setString(4, arr[0]);
//
//								stmt.setDouble(5, Double.valueOf(arr[1]));
//								stmt.setDouble(6, Double.valueOf(arr[2]));
//								stmt.setDouble(7, Double.valueOf(arr[3]));
//								stmt.setDouble(8, Double.valueOf(arr[4]));
//								stmt.setDouble(9, Double.valueOf(arr[5]));
//								stmt.setDouble(10, Double.valueOf(arr[6]));
//								stmt.setDouble(11, Double.valueOf(arr[7]));
//								stmt.setDouble(12, Double.valueOf(arr[8]));
//								stmt.setDouble(13, Double.valueOf(arr[9]));
//								stmt.setDouble(14, Double.valueOf(arr[10]));
//								stmt.setDouble(15, Double.valueOf(arr[11]));
//								stmt.setDouble(16, Double.valueOf(arr[12]));
//								stmt.setDouble(17, Double.valueOf(arr[13]));
//								stmt.setDouble(18, Double.valueOf(arr[14]));
//
//								stmt.setString(19, arr[15]);
//								stmt.setString(20, arr[16]);
//								stmt.setString(21, arr[17]);
//								
//								if (arr[19].equals("中国")) {
//									stmt.setString(22, arr[18]);
//									stmt.setString(23, arr[19]);
//									stmt.setString(24, arr[20]);
//								} else {
//									stmt.setString(12, "");
//									stmt.setString(23, "");
//									stmt.setString(24, "");
//								}
//								stmt.setString(25, "");
//								stmt.setString(26, "");
//								stmt.setString(27, "");
//							}
//								break;
//							case 22: {
////								if(arr[3].compareTo("900000") > 0) arr[3] = "0";
////								if(arr[4].compareTo("900000") > 0) arr[4] = "0";
////								if(arr[5].compareTo("900000") > 0) arr[5] = "0";
////								if(arr[6].compareTo("900000") > 0) arr[6] = "0";
////								if(arr[7].compareTo("900000") > 0) arr[7] = "0";
////								if(arr[8].compareTo("900000") > 0) arr[8] = "0";
////								if(arr[9].compareTo("900000") > 0) arr[9] = "0";
////								if(arr[10].compareTo("900000") > 0) arr[10] = "0";
////								if(arr[11].compareTo("900000") > 0) arr[11] = "0";
////								if(arr[12].compareTo("900000") > 0) arr[12] = "0";
////								if(arr[13].compareTo("900000") > 0) arr[13] = "0";
////								if(arr[14].compareTo("900000") > 0) arr[14] = "0";
//								
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setLong(2, Long.valueOf(radartime));
//								stmt.setString(3, arr[0] + radartime);
//								stmt.setString(4, arr[0]);
//
//								stmt.setDouble(5, Double.valueOf(arr[1]));
//								stmt.setDouble(6, Double.valueOf(arr[2]));
//								stmt.setDouble(7, Double.valueOf(arr[3]));
//								stmt.setDouble(8, Double.valueOf(arr[4]));
//								stmt.setDouble(9, Double.valueOf(arr[5]));
//								stmt.setDouble(10, Double.valueOf(arr[6]));
//								stmt.setDouble(11, Double.valueOf(arr[7]));
//								stmt.setDouble(12, Double.valueOf(arr[8]));
//								stmt.setDouble(13, Double.valueOf(arr[9]));
//								stmt.setDouble(14, Double.valueOf(arr[10]));
//								stmt.setDouble(15, Double.valueOf(arr[11]));
//								stmt.setDouble(16, Double.valueOf(arr[12]));
//								stmt.setDouble(17, Double.valueOf(arr[13]));
//								stmt.setDouble(18, Double.valueOf(arr[14]));
//
//								stmt.setString(19, arr[15]);
//								stmt.setString(20, arr[16]);
//								stmt.setString(21, arr[17]);
//								
//								if (arr[19].equals("中国")) {
//									stmt.setString(22, arr[18]);
//									stmt.setString(23, arr[19]);
//									stmt.setString(24, arr[20]);
//									stmt.setString(25, arr[21]);
//								} else {
//									stmt.setString(22, "");
//									stmt.setString(23, "");
//									stmt.setString(24, "");
//									stmt.setString(25, "");
//								}
//								stmt.setString(26, "");
//								stmt.setString(27, "");
//							}
//								break;
//							case 23: {
////								if(arr[3].compareTo("900000") > 0) arr[3] = "0";
////								if(arr[4].compareTo("900000") > 0) arr[4] = "0";
////								if(arr[5].compareTo("900000") > 0) arr[5] = "0";
////								if(arr[6].compareTo("900000") > 0) arr[6] = "0";
////								if(arr[7].compareTo("900000") > 0) arr[7] = "0";
////								if(arr[8].compareTo("900000") > 0) arr[8] = "0";
////								if(arr[9].compareTo("900000") > 0) arr[9] = "0";
////								if(arr[10].compareTo("900000") > 0) arr[10] = "0";
////								if(arr[11].compareTo("900000") > 0) arr[11] = "0";
////								if(arr[12].compareTo("900000") > 0) arr[12] = "0";
////								if(arr[13].compareTo("900000") > 0) arr[13] = "0";
////								if(arr[14].compareTo("900000") > 0) arr[14] = "0";
//								
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setLong(2, Long.valueOf(radartime));
//								stmt.setString(3, arr[0] + radartime);
//								stmt.setString(4, arr[0]);
//
//								stmt.setDouble(5, Double.valueOf(arr[1]));
//								stmt.setDouble(6, Double.valueOf(arr[2]));
//								stmt.setDouble(7, Double.valueOf(arr[3]));
//								stmt.setDouble(8, Double.valueOf(arr[4]));
//								stmt.setDouble(9, Double.valueOf(arr[5]));
//								stmt.setDouble(10, Double.valueOf(arr[6]));
//								stmt.setDouble(11, Double.valueOf(arr[7]));
//								stmt.setDouble(12, Double.valueOf(arr[8]));
//								stmt.setDouble(13, Double.valueOf(arr[9]));
//								stmt.setDouble(14, Double.valueOf(arr[10]));
//								stmt.setDouble(15, Double.valueOf(arr[11]));
//								stmt.setDouble(16, Double.valueOf(arr[12]));
//								stmt.setDouble(17, Double.valueOf(arr[13]));
//								stmt.setDouble(18, Double.valueOf(arr[14]));
//
//								stmt.setString(19, arr[15]);
//								stmt.setString(20, arr[16]);
//								stmt.setString(21, arr[17]);
//								
//								if (arr[19].equals("中国")) {
//									stmt.setString(22, arr[18]);
//									stmt.setString(23, arr[19]);
//									stmt.setString(24, arr[20]);
//									stmt.setString(25, arr[21]);
//									stmt.setString(26, arr[22]);
//								} else {
//									stmt.setString(22, "");
//									stmt.setString(23, "");
//									stmt.setString(24, "");
//									stmt.setString(25, "");
//									stmt.setString(26, "");
//								}
//								stmt.setString(27, "");
//							}
//								break;
//							case 24: {
////								if(arr[3].compareTo("900000") > 0) arr[3] = "0";
////								if(arr[4].compareTo("900000") > 0) arr[4] = "0";
////								if(arr[5].compareTo("900000") > 0) arr[5] = "0";
////								if(arr[6].compareTo("900000") > 0) arr[6] = "0";
////								if(arr[7].compareTo("900000") > 0) arr[7] = "0";
////								if(arr[8].compareTo("900000") > 0) arr[8] = "0";
////								if(arr[9].compareTo("900000") > 0) arr[9] = "0";
////								if(arr[10].compareTo("900000") > 0) arr[10] = "0";
////								if(arr[11].compareTo("900000") > 0) arr[11] = "0";
////								if(arr[12].compareTo("900000") > 0) arr[12] = "0";
////								if(arr[13].compareTo("900000") > 0) arr[13] = "0";
////								if(arr[14].compareTo("900000") > 0) arr[14] = "0";
//								
//								id_n++;
//								stmt.setInt(1, id_n);
//								stmt.setLong(2, Long.valueOf(radartime));
//								stmt.setString(3, arr[0] + radartime);
//								stmt.setString(4, arr[0]);
//
//								stmt.setDouble(5, Double.valueOf(arr[1]));
//								stmt.setDouble(6, Double.valueOf(arr[2]));
//								stmt.setDouble(7, Double.valueOf(arr[3]));
//								stmt.setDouble(8, Double.valueOf(arr[4]));
//								stmt.setDouble(9, Double.valueOf(arr[5]));
//								stmt.setDouble(10, Double.valueOf(arr[6]));
//								stmt.setDouble(11, Double.valueOf(arr[7]));
//								stmt.setDouble(12, Double.valueOf(arr[8]));
//								stmt.setDouble(13, Double.valueOf(arr[9]));
//								stmt.setDouble(14, Double.valueOf(arr[10]));
//								stmt.setDouble(15, Double.valueOf(arr[11]));
//								stmt.setDouble(16, Double.valueOf(arr[12]));
//								stmt.setDouble(17, Double.valueOf(arr[13]));
//								stmt.setDouble(18, Double.valueOf(arr[14]));
//
//								stmt.setString(19, arr[15]);
//								stmt.setString(20, arr[16]);
//								stmt.setString(21, arr[17]);
//								
//								if (arr[19].equals("中国")) {
//									stmt.setString(22, arr[18]);
//									stmt.setString(23, arr[19]);
//									stmt.setString(24, arr[20]);
//									stmt.setString(25, arr[21]);
//									stmt.setString(26, arr[22]);
//									stmt.setString(27, arr[23]);
//								} else {
//									stmt.setString(22, "");
//									stmt.setString(23, "");
//									stmt.setString(24, "");
//									stmt.setString(25, "");
//									stmt.setString(26, "");
//									stmt.setString(27, "");
//								}
//							}
//								break;
//							default: {
////								System.out.println("n: " + n + " line" + line + ":" + temp);
//								line++;
//								continue;
//							}
//							}
//							stmt.execute();
//						}
//					} catch (SQLNonTransientException e) {
//						// TODO 自动生成的 catch 块
//						e.printStackTrace();
//					}
//					line++;
//				}
//				System.out.println("n: " + n + " line: " + line );
//				n++;
//				// 修改文件名称 添加前缀
//				StringFileUtils.changeFileName(fileStr, "temp_");
//				duringTime = System.currentTimeMillis() - taskStartTime;
//				sumTime += duringTime;
//			}
//		} catch (Exception e) {
//			e.printStackTrace();
//		} finally {
//			if (reader != null) {
//				try {
//					reader.close();
//				} catch (Exception e) {
//					e.printStackTrace();
//				}
//			}
//		}
//	}
//
////	public static void main(String[] args) throws Exception{
//////		test3();
////	}
//}
